<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<%@include file="/WEB-INF/jspf/meta/meta.jspf"%>
<title>班级管理</title>
<%@include file="/WEB-INF/jspf/adminPage.jspf"%>
<script type="text/javascript"
	src="<%=request.getContextPath()%>/static/grade/grade.js"></script>
</head>

<script type="text/javascript">

</script>

</head>
<body>
<form id="ff" method="post">
	<table>
		<tr>
			<select id="teacherId" editable="false" class="easyui-combobox" name="teacherId" data-options="label:'选择教师:'" style="width: 218px"></select>
		</tr>
		<tr>
			<td>班级名称:</td>
			<td><input type="easyui-textbox" name="gradeName"/></td>
		</tr>

		<tr>
			<td>班级备注:</td>
			<td><input class="easyui-textbox" type="text"
					   name="gradeInfo" data-options="multiline:true"
					   style="height: 60px"></input></td>
		</tr>
	</table>
</form>
<div>
	<a href="javascript:void(0)" class="easyui-linkbutton" onclick="submitForm()">提交</a>
	<a href="javascript:void(0)" class="easyui-linkbutton" onclick="clearForm()">清空</a>
</div>
	<script>
	function submitForm(){
		$('#ff').form({
		    url:'<%=request.getContextPath()%>/grade/insertGrade.json',
				onSubmit : function() {
					return $(this).form('enableValidation').form('validate');
				},
				success : function(data) {
					var d=JSON.parse(data);
					//假如后台添加成功
					$.messager.show({
						title:'操作提示',
						msg:d.msg,
						timeout:3000,
						showType:'slide'
					});
					if(d.code=='1'){
						$('#ff').form('clear');
					}
				}
			});
			$('#ff').submit();
		}
		function clearForm() {
			$('#ff').form('clear');
		}
	</script>

<%-- 动态绑定Combobox下拉框内容 --%>
<%@include file="/WEB-INF/jsp/_combobox.jspf"%>
</body>
</html>